﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

/// <summary>
/// 设备
/// </summary>
[Index("tp_complete", Name = "idxcomplete")]
[Index("tp_guid", Name = "idxlguid")]
[Index("tp_status", Name = "idxstatus")]
[Index("tp_auto_run", Name = "tp_auto_run")]
[Index("tp_auto_run_join", Name = "tp_auto_run_jion")]
[Index("tp_p_guid", Name = "tp_p_guid")]
public partial class iot_device_task_plain
{
    [Key]
    public long tp_id { get; set; }

    public string tp_guid { get; set; }

    /// <summary>
    /// 标题
    /// </summary>
    [StringLength(50)]
    public string tp_title { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? tp_add_time { get; set; }

    /// <summary>
    /// 0正常，1无效
    /// </summary>
    public int tp_status { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime? tp_mod_time { get; set; }

    /// <summary>
    /// 运行批次
    /// </summary>
    [StringLength(50)]
    public string tp_execute_batch_no { get; set; }

    /// <summary>
    /// 0未完成，1已完成
    /// </summary>
    public int? tp_complete { get; set; }

    /// <summary>
    /// 处理中时间，tp_complete=0时，1分钟内在线视为处理中
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? tp_set_live_time { get; set; }

    /// <summary>
    /// 运行时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? tp_execute_time { get; set; }

    /// <summary>
    /// 完成时间
    /// </summary>
    [Column(TypeName = "datetime")]
    public DateTime? tp_complete_time { get; set; }

    [StringLength(100)]
    public string tp_c_guid { get; set; }

    /// <summary>
    /// 0否，1是产品型号,2由模板生成的产品
    /// </summary>
    public int tp_is_template { get; set; }

    /// <summary>
    /// 产品iot_device_product
    /// </summary>
    [StringLength(50)]
    public string tp_p_guid { get; set; }

    /// <summary>
    /// 0启动，1不启动
    /// </summary>
    public int? tp_auto_run { get; set; }

    /// <summary>
    /// 0不参与自动配置，1参与自动配置
    /// </summary>
    public int? tp_auto_run_join { get; set; }

    /// <summary>
    /// 产品序号
    /// </summary>
    public int? tp_p_model_no { get; set; }
}
